package com.x.erp.model;

import com.x.framework.annotation.MappingColumn;
import com.x.framework.annotation.MappingTable;
import com.x.framework.model.BaseObject;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 车辆日志信息
 * 
 * @author yangyonghao
 */
@MappingTable(tableName = "ERP_CAR_LOG")
public class CarLog extends BaseObject {
	private static final long serialVersionUID = 6117934339342538838L;

	@MappingColumn(columnName = "CAR_LOG_ID", columnPk = true, columnLength = 32)
	private String carLogId;// 车辆日志ID

	@MappingColumn(columnName = "CAR_LOG_INFO")
	private String carLogInfo;// 日志信息

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@MappingColumn(columnName = "CAR_LOG_CREATE_TIME")
	private Date carLogCreateTime;// 创建时间

	@MappingColumn(columnName = "CAR_STATE_KEY")
	private String carStateKey;// 车辆状态key

	@MappingColumn(columnName = "CAR_STATE_VALUE")
	private Integer carStateValue;// 车辆状态value

	@MappingColumn(columnName = "CAR_LOG_SOURCE")
	private String carLogSource;// 车辆日志来源

	@MappingColumn(columnName = "USER_ID")
	private String userId;// 操作用户ID

	@MappingTable(tableName = "ERP_USER")
	private User user;// 操作用户信息

	@MappingColumn(columnName = "CAR_ID")
	private String carId;// 车辆ID

	@MappingTable(tableName = "ERP_CAR")
	private Car car;// 车辆信息

	public CarLog() {
	}

	public CarLog(String carLogInfo, Date carLogCreateTime, String userId, String carId) {
		this.carLogInfo = carLogInfo;
		this.carLogCreateTime = carLogCreateTime;
		this.userId = userId;
		this.carId = carId;
	}
	
	public CarLog(String carLogInfo, Date carLogCreateTime, String userId, String carId, String carStateKey, Integer carStateValue) {
		this.carLogInfo = carLogInfo;
		this.carLogCreateTime = carLogCreateTime;
		this.userId = userId;
		this.carId = carId;
		this.carStateKey = carStateKey;
		this.carStateValue = carStateValue;
	}
	
	public CarLog(Date carLogCreateTime, String userId, String carId, String carStateKey, Integer carStateValue) {
		this.carLogCreateTime = carLogCreateTime;
		this.userId = userId;
		this.carId = carId;
		this.carStateKey = carStateKey;
		this.carStateValue = carStateValue;
	}

	public CarLog(Date carLogCreateTime, String userId, String carId) {
		this.carLogCreateTime = carLogCreateTime;
		this.userId = userId;
		this.carId = carId;
	}

	public String getCarLogId() {
		return carLogId;
	}

	public void setCarLogId(String carLogId) {
		this.carLogId = carLogId;
	}

	public String getCarLogInfo() {
		return carLogInfo;
	}

	public void setCarLogInfo(String carLogInfo) {
		this.carLogInfo = carLogInfo;
	}

	public Date getCarLogCreateTime() {
		return carLogCreateTime;
	}

	public void setCarLogCreateTime(Date carLogCreateTime) {
		this.carLogCreateTime = carLogCreateTime;
	}

	public String getCarStateKey() {
		return carStateKey;
	}

	public void setCarStateKey(String carStateKey) {
		this.carStateKey = carStateKey;
	}

	public Integer getCarStateValue() {
		return carStateValue;
	}

	public void setCarStateValue(Integer carStateValue) {
		this.carStateValue = carStateValue;
	}

	public String getCarLogSource() {
		return carLogSource;
	}

	public void setCarLogSource(String carLogSource) {
		this.carLogSource = carLogSource;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getCarId() {
		return carId;
	}

	public void setCarId(String carId) {
		this.carId = carId;
	}

	public Car getCar() {
		return car;
	}

	public void setCar(Car car) {
		this.car = car;
	}
}
